var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(e, t) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(e, t) {
        e.__proto__ = t;
    } || function(e, t) {
        for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]);
    })(e, t);
}, function(e, t) {
    function n() {
        this.constructor = e;
    }
    o(e, t), e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, 
    new n());
}), a = this && this.__decorate || function(e, t, o, n) {
    var r, a = arguments.length, c = a < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, o) : n;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) c = Reflect.decorate(e, t, o, n); else for (var l = e.length - 1; 0 <= l; l--) (r = e[l]) && (c = (a < 3 ? r(c) : 3 < a ? r(t, o, c) : r(t, o)) || c);
    return 3 < a && c && Object.defineProperty(t, o, c), c;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("AudioManager"), s = e("UIManager"), c = e("Global"), l = e("PrefabView"), d = cc._decorator, u = d.ccclass, p = d.property, h = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.shadow = null, e.skeleton = null, e;
    }
    return i(e, t), e.prototype.onLoad = function() {
        this.shadow.setContentSize(cc.winSize);
    }, e.prototype.start = function() {
        var t = this;
        r.default.getInstance().playAudio("宝箱打开时音效"), this.skeleton.setAnimation(0, "open", !1), 
        this.skeleton.setCompleteListener(function() {
            t.skeleton.setCompleteListener(null), t.skeleton.node.active = !1, t.shadow.color = cc.Color.WHITE, 
            t.scheduleOnce(function() {
                var e;
                c.G.queue.splice(0, 0, {
                    name: "reward",
                    type: 2,
                    data: PD.data
                }), 0 < c.G.queue.length && (1 == (e = c.G.queue.shift()).type ? s.default.getInstance().loadPnl(e.name) : 2 == e.type && s.default.getInstance().loadPopPnl(e.name, e.data)), 
                t.hidePnl();
            }, .05);
        });
    }, a([ p(cc.Node) ], e.prototype, "shadow", void 0), a([ p(sp.Skeleton) ], e.prototype, "skeleton", void 0), 
    a([ u ], e);
}(l.default);

n.default = h;